home *** CD-ROM | disk | FTP | other *** search
- /* ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
-
- CThread.h
-
- Thread Manager class.
-
- SUPERCLASS = CObject.
-
- Copyright © 1994-95 Ithran Einhorn. All rights reserved.
-
- ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞ */
-
- #ifndef _H_CThread
- #define _H_CThread
-
- #include <CObject.h> /* Interface for its superclass */
-
- #include "Threads.h" /* Apple Includes */
-
- class CCluster;
-
- /* Class definition */
-
- #define kPoolSegment 10 // number of threads to allocate at a time
-
- class CThread : public CObject {
-
- protected:
-
- /* Class Variables */
-
- static CCluster *cThreadList;
- static long threadCount;
-
- /* Instance Variables */
- Str32 threadName;
- ThreadID itsThreadID;
- ThreadStyle itsThreadStyle;
- CObject *itsObject;
- OSErr lastThreadErr;
- Boolean isActive;
-
- public:
-
- /* Instance Variables */
-
- Boolean active;
-
- /* Class Methods */
-
- static Boolean cIsPresent(void);
- static void cInitManager(void);
- static short cGetTMVersion(void);
- static CThread *ThreadObjectFromID(ThreadID threadID);
- static OSErr YieldToThread (CThread *suggestedThread);
- static CThread *GetCurrentThread (void);
-
- /* Instance Methods */
-
- void IThread(ThreadStyle threadStyle, ThreadEntryProcPtr callBackFunction, CObject *threadedObject, Size stackSize = 0);
- virtual void Dispose(void);
- ThreadID GetID(void);
- void SetName(Str32 name);
- OSErr LastError(void);
- Boolean IsActive(void);
- OSErr CurrentStackSpace(unsigned long *freeStack);
- OSErr GetThreadState(ThreadState *threadState);
- OSErr SetThreadState(ThreadState newState,CThread *suggestedThread);
- };
-
- #endif
-
- /* ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞ */
-